package com.myhome.money.ssm.springmvc.controller;

import com.myhome.money.ssm.springmvc.model.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Rod
 */
@Controller
public class DemoController {

    private List<Student> getList() {
        List<Student> list = new ArrayList<Student>();
        for (int i = 100; i < 907; i++) {
            Student student = new Student();
            student.setId(i);
            student.setAddress(i + "地址" + i);
            student.setAge(i - 100);
            student.setName(i + "第" + i + "个姓名");
            student.setStuNo("学号" + i);
            list.add(student);
        }
        return list;
    }

    @RequestMapping("index")
    @ResponseBody
    public List<Student> index() {
        return getList();
    }
}
